﻿using Bomber.TF.Common.GDI;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bomber.TF.GameCenter.BlockCenter
{
    [Species(SpeciesType.HardBlock)]
    public class HardBlock : BlockBase
    {
        protected static ImageObject _imageObject;
        static HardBlock()
        {
            _imageObject = new ImageObject(Properties.Resources.HardBlock);
        }
        public HardBlock(int w, int h) : base(SpeciesType.HardBlock, new Size(w, h))
        {

        }
        public override void Draw(Graphics g)
        {
            IntPtr hdc = g.GetHdc();
            GDI32.DrawImageTransparenc(hdc, _imageObject.BitmapPtr, Location.X, Location.Y, _imageObject.Width, _imageObject.Height, Size.Width, Size.Height);
            g.ReleaseHdc(hdc);
        }
        protected override void DisposeAll()
        {
            if (_imageObject != null)
                _imageObject.Dispose();
        }
    }
}
